package edu.scau.misp.backend_module.service;

import edu.scau.misp.backend_module.core.rms_dto.OrderDTO;
import edu.scau.misp.backend_module.domain.Deal;
import edu.scau.misp.backend_module.domain.DishAddition;
import edu.scau.misp.backend_module.domain.OrderItem;

import java.math.BigDecimal;
import java.util.List;

public interface IOrderDTOService {

    /**
     * 开始新的订单
     */
    OrderDTO makeNewOrder();

//    /**
//     * 实例化SaleItem
//     * @param orderItem 商品对象
//     * @param quantity 数量
//     */
//    void makeLineItem(OrderItem orderItem, int quantity);
    /**
     * 实例化SaleItem
     * @param dishAddition 商品对象
     * @param quantity 数量
     */
    void makeLineItemDishAddition(DishAddition dishAddition, int quantity);
    /**
     * 实例化SaleItem
     * @param deal 商品对象
     * @param quantity 数量
     */
    void makeLineItemDeal(Deal deal, int quantity);

    /**
     * 结束订单商品录入
     * @return 总金额
     */
    BigDecimal orderEnd();

    /**
     * 订单支付
     * @param cashTendered 付款金额
     * @return 找零
     */
    BigDecimal makePayment(BigDecimal cashTendered);


    void changeQuantityOfOrderItem(String itemSn, int quantity);

    void deleteOrderItemBySn(String itemSn);
    //-------------------------------------------------

//    order
    public OrderDTO getOrderDTOById(Long orderId);

    public List<OrderDTO> listAllOrderDTO();



    public List<OrderDTO> selectOrderDTOList(OrderDTO orderDTO);


    public int insertOrderDTO(OrderDTO orderDTO);



    public int updateOrderDTO(OrderDTO orderDTO);

    public int deleteOrderDTOById(Long orderId);
}
